package generator;

import java.util.ArrayList;

import db.RantanplanContext;

public class PersistenceContext extends RantanplanContext {
	
	private String sourceFolder;
	private String packageName;
	private ArrayList<String> tableWhiteList = null;
	
	public PersistenceContext() {
		
	}
	
	public String getSourceFolder() {
		return sourceFolder;
	}
	public void setSourceFolder(String sourceFolder) {
		this.sourceFolder = sourceFolder;
	}
	public String getPackageName() {
		return packageName;
	}
	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}
	
	public String getPackageFolder() {
		return packageName.replace(".", "/") + "/";
	}
	
	public void addTableToWhitelist(String tableName) {
		if (this.tableWhiteList == null) {
			this.tableWhiteList = new ArrayList<String>();
		}
		this.tableWhiteList.add(tableName);
	}
	
	public boolean isTableWhitelisted(String tableName) {
		return this.tableWhiteList == null || this.tableWhiteList.contains(tableName);
	}

}
